using System;
using System.Collections.Generic;
using GameProtocols;

namespace Network 
{
    public static class ProtoRouter
    {
        public static Dictionary<int, System.Type> IdToType = new Dictionary<int, System.Type>
        {
            { (int)ProtoId.MSG_SYN_STATE_REQ, typeof(PKG_SYN_STATE_REQ) },
            { (int)ProtoId.MSG_SYN_STATE_NTF, typeof(PKG_SYN_STATE_NTF) },

            { (int)ProtoId.MSG_OPERATION, typeof(PKG_OPERATION) },
            { (int)ProtoId.MSG_FRAME, typeof(PKG_FRAME) },
        };
    }

    

    public static class SerializerRouter
    {
        public static Dictionary<int, System.Func<byte[], object>> Deserialier = new Dictionary<int, System.Func<byte[], object>>
        {
            
        };
    }


    public enum JsonMsgId
    {
        GMConsoleCommand = 0,
        LogonRequest = 1,
        LogonResponse = 2,
        JoinRoomRequest = 3,
        JoinRoomResponse = 4,
        LeaveRoomRequest = 5,
        LeaveRoomResponse = 6,
        FollowRoomRequest = 7,
        FollowRoomResponse = 8,

        ChangeNameRequest = 11,
        ChangeNameResponse = 12,
        UserRecordRequest = 13,
        UserRecordResponse = 14,
        UserSignQueryRequest=15,
        UserSignQueryResponse=16,
        UserSignRequest =17,
        UserSignResponse=18,

        SaveTutorialRequest = 21,
        SaveTutorialResponse = 22,
        QueryTutorialRequest = 23,
        QueryTutorialResponse = 24,
        QueryRankRequest = 25,
        QueryRankResponse = 26,
        ChangeIconRequest=27,
        ChangeIconResponse=28,

        AssetRequest =31,
        AssetResponse=32,
        ChangeShipAppearanceRequest=33,
        ChangeShipAppearanceResponse=34,
        ChangeShipRequest=35,
        ChangeShipResponse=36,
        ChangeCannonAppearanceRequest=37,
        ChangeCannonAppearanceResponse=38,
        QueryCannonRequest = 41,
        QueryCannonResponse = 42,
        QueryBattleShipRequest = 39,
        QueryBattleShipResponse = 40,
        ShopRequest =51,
        ShopResponse = 52,

        ChestListRequest = 61,
        ChestListResponse = 62,
        ChestProgressQueryRequest = 63,
        ChestProgressQueryResponse = 64,

        AddFriendRequest = 71,
        AddFriendResponse = 72,
        DelFriendRequest = 73,
        DelFriendResponse = 74,
        ListFriendRequest = 75,
        ListFriendResponse = 76,
        ListWatcherRequest = 77,
        ListWatcherResponse = 78,
        QueryUserRequest = 79,
        QueryUserResponse = 80,
        QueryUserListInfoRequest = 83,
        QueryUserListInfoResponse = 84,
        QueryUserInfoRequest=81,
        QueryUserInfoResponse=82,
        CheckTwoWayFriendRequest=85,
        CheckTwoWayFriendResponse=86,
        QueryWatchersCountRequest = 87,
        QueryWatchersCountResponse = 88,

        SendIMRequest = 91,
        SendIMResponse = 92,
        ResendIMRequest = 93,
        ResendIMResponse = 94,
        DelIMRequest = 95,
        DelIMResponse = 96,
        RoomChatRequest = 97,
        RoomChatMessageRequest = 99,
        SetChatMessageRequest = 101,
        SetChatMessageResponse = 102,
        GetChatMessageRequest = 103,
        GetChatMessageResponse = 104,

        SetOnlyTwowayFollowRequest = 151,
        QueryIsOnlyTwowayFollow = 153,
        ChangeNamePriceRequest=155,
        QueryNameTestRequest=157,

        ListMailRequest = 201,
        ListMailResponse = 202,
        ReadMailRequest = 203,
        ReadMailResponse = 204,
        FinishMailRequest = 205,
        FinishMailResponse = 206,

        ListAchRequest=231,
        ListAchResponse=232,
        GetAchAwardRequest=233,
        GetAchAwardResponse=234,

        EventUpdateNotify = 301,

        //GM
        getuserbyuid = 1000,
        addItem=1002,
        login = 1003
    }

    public enum LocalGMID
    {
        game,
        clear
    }
}
